names = ['tom','jack','alice','mike']

# print(names)

# 使用while循环
# i = 0
# while i<len(names):
#     print(names[i])
#     i += 1

# 使用for...in循环
# for name in names:
#     print(name)


# 使用range()生成一个序列
# for i in range(1,100): # 生成一个[1,100)之间的整数序列，称为左闭右开
#     print(i)

# 计算1到100的和
# sum = 0
# for i in range(1,101):
#     sum += i
# print('总和为：', sum)